﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAL;

namespace BLL
{
    public class AutoSettingBLL
    {
        /// <summary>
        /// 添加自动设置
        /// </summary>
        /// <returns></returns>
        public static bool AddAutoSetting(AutoSetting entity)
        {
            AutoSettingDAL dal = new AutoSettingDAL();
            return dal.Insert(entity);
        }
        /// <summary>
        /// 获取用户自动记账设置
        /// </summary>
        /// <param name="aid">用户ID</param>
        /// <returns></returns>
        public static List<AutoSetting> GetAutoSettingByAID(int aid)
        {
            AutoSettingDAL dal = new AutoSettingDAL();
            return dal.QueryByAID(aid);
            
        }

        public static bool UpdateAutoSetting(AutoSetting auto)
        {
            AutoSettingDAL dal = new AutoSettingDAL();
            return dal.Update(auto);
        }
    }
}
